mod test {
    use my_util_lib::log_util;
    use rust_my_tools::{dao::mysql::mysql_dao, service::article_service};

    use tokio::runtime::Builder;
    fn cre_runtime() -> tokio::runtime::Runtime {
        // 创建一个 Tokio 运行时，配置线程池的大小
        Builder::new_multi_thread()
            .worker_threads(1) // 设置工作线程的数量
            .max_blocking_threads(16) // 设置阻塞任务的最大线程数
            .enable_all()
            .build()
            .unwrap()
    }
    #[test]
    pub fn test_inert2db() {
        let r = cre_runtime();
        let i = r
            .block_on(async {
                let pool = mysql_dao::get_conn_pool(
                    "mysql://denglibin:denglibin@192.168.6.231:3307/yuqing_data",
                    5,
                )
                .await?;
                article_service::excel2db(r"D:\yiscn\人民日报\医院侵权监测.xlsx".into(), &pool)
                    .await
            })
            .unwrap();

        println!("插入成功:{}", i);
    }
    #[test]
    pub fn test_get_content() {
        log_util::init_log("log4rs.yaml").unwrap();
        let r = cre_runtime();
        let _ = r
            .block_on(async {
                let pool = mysql_dao::get_conn_pool(
                    "mysql://denglibin:denglibin@192.168.6.231:3307/yuqing_data",
                    5,
                )
                .await?;
                article_service::get_url_cotent(r"http://localhost:9515".into(), &pool).await
            })
            .unwrap();

        log::info!("完成");
    }
    #[test]
    pub fn test_get_orgs() {
        log_util::init_log("log4rs.yaml").unwrap();
        let r = cre_runtime();
        let _ = r
            .block_on(async {
                let pool = mysql_dao::get_conn_pool(
                    "mysql://denglibin:denglibin@192.168.6.231:3307/yuqing_data",
                    5,
                )
                .await?;
                article_service::extract_entites(
                    r"http://192.168.6.128:9114/entities".into(),
                    &pool,
                )
                .await
            })
            .unwrap();

        log::info!("完成");
    }
    #[test]
    pub fn test_analysis_fu_wai() {
        log_util::init_log("log4rs.yaml").unwrap();
        let r = cre_runtime();
        let _ = r
            .block_on(async {
                let pool = mysql_dao::get_conn_pool(
                    "mysql://denglibin:denglibin@192.168.6.231:3307/yuqing_data",
                    5,
                )
                .await?;
                article_service::analysis_fu_wai(&pool).await
            })
            .unwrap();

        log::info!("完成");
    }
}
